<template>
  <div id="right3"></div>
</template>
<script>
import * as echarts from "echarts";
import { http } from "@/api/request";
export default {
  data() {
    return {};
  },
  methods: {},
  components: {},
  computed: {},
  watch: {},
  created() {},
  async mounted() {
    var {importStatis}=await http()
    var list=[]
    importStatis.TopList.forEach(item=>{
      list.push({name:item.province,value:item.importedCase})
    })
    var chartDom = document.getElementById("right3");
    var myChart = echarts.init(chartDom);
    window.onresize = function() {
      myChart.resize()
    }
    var option = {
        title: {
        text: "境外输入病情top10省份",
        x: "center",
        y: "4%",
        textStyle: {
          color: "#fff",
          fontSize: "22",
        },
        subtextStyle: {
          color: "#90979c",
          fontSize: "16",
        },
      },
  series: [
    {
      name: 'Nightingale Chart',
      type: 'pie',
      radius: [10, 80],
      center: ['50%', '50%'],
      roseType: 'area',
      itemStyle: {
        borderRadius: 1
      },
      data: list
    }
  ]
};
    option && myChart.setOption(option);
  },
};
</script>
<style lang="scss" scoped>
#right3 {
  width: 100%;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
}
</style>
